using Microsoft.EntityFrameworkCore;

namespace CommunityToolkit.ReportEditor.Model.Models;

public class DataSourceContext: DbContext
{
    public DbSet<DataScript> DataScripts { get; set; }

    private string DbPath { get; }
    
    public DataSourceContext()
    {
        DbPath = Path.Join(Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData), "CommunityToolkit.ReportDesigner\\report_data_sources.db");
    }

    protected override void OnConfiguring(DbContextOptionsBuilder options)
        => options.UseSqlite($"Data Source={DbPath}");
}